/*
Copyright (C) 2008 Kamal Singh.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

_wmp = WMPEmbed.object;

var playing = true;


/* pause_onclick */
function stop_onclick() {
	_wmp.controls.stop();
	playing = false;
  notPlaying();
}

/* play_onclick */
function play_onclick() {
	_wmp.controls.play();
	playing = true;
  isPlaying();
}

function notPlaying() {
	playing = false;
	play.visible = true;
	stop.visible = false;
}

function isPlaying()	 {
	playing = true;
	play.visible = false;
	stop.visible = true;
}

/* animation helper method */
function mouseOver()	{
	if(playing) {
		stop.visible = true;
    volume.visible = true;
  }
	else {
		play.visible = true;
    volume.visible = true;
  }
}

/* animation helper method */
function mouseOut()	{
	play.visible = false;
	stop.visible = false;
  volume.visible = false;
}

function onMinimized() {
  _wmp.controls.stop();
}

function onRestore() {
  _wmp.controls.play();
  playing = true;
}

/* volume control helper method */
function volume_onchange() {
  if( _wmp == null ) return;
  _wmp.settings.volume = volume.value;
}